package zzzhc.image.recognize;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class FilterManager implements Filter {

	private static final long serialVersionUID = -4643351751546955217L;

	private List<Filter> filterList = new ArrayList<Filter>();

	public FilterManager() {

	}

	public FilterManager(FilterManager fm) {
		filterList.addAll(fm.filterList);
	}

	public void addFilter(Filter filter) {
		filterList.add(filter);
	}

	public void clear() {
		filterList.clear();
	}

	public void doFilter(RecognizeContext source) {
		for (Filter filter : filterList) {
			filter.doFilter(source);
		}
	}

	public Iterator<Filter> iterator() {
		return filterList.iterator();
	}

	public int size() {
		return filterList.size();
	}

}
